refactor: convert global modulestore to request-cached#37859
Closed
ormsbee wants to merge 1 commit intoopenedx:masterfrom
Closed
refactor: convert global modulestore to request-cached#37859ormsbee wants to merge 1 commit intoopenedx:masterfrom
ormsbee wants to merge 1 commit intoopenedx:masterfrom
Conversation
49ec474 to
0fb612a
Compare
Contributor
Author
|
@robrap and @timmc-edx flagged that 2U has seen operational issues related to having too many MongoDB connections:
|
1e21654 to
095a87b
Compare
Having a global modulestore reference is a holdover from the early days, when the XML modulestore would be extremely expensive to initialize. That is no longer the case, and we should eliminate the global here to reduce the chances of multi-threading bugs that might mutate the global. Unfortunately, a lot of code currently assumes that calls to the modulestore() function are essentially free, instead of the 1-2 ms it is without caching. There are cases where this may be called thousands of times deep in loops somewhere while doing course content traversal, so it's risky to eliminate the caching behavior altogether. The thought here is that we'll tie to the RequestCache, which should at least not be shared across users/threads. Since new instances of the modulestore will not have cached entries for a particular course, it means that some query count tests have to be adjusted upward.
095a87b to
d7825b2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A more modest version of #37842